<?php
//require dirname(__FILE__) . '/db/acc-conn.php';
require $_SERVER['DOCUMENT_ROOT'] . '/accHestia/init/acc_xml_builder.php';

$db = new acc_DB();
if(!$db){
	echo $db->lastErrorMsg();
	return;
} else {
	//echo "Opened database successfully\n";
}

//$sql = "select count(*) from users where uid='su' and pwd = '81dc9bdb52d04dc20036dbd8313ed055'";
$sql = "select * from users where id>='6';";
echo "----------<br/>";
echo $db->afr($sql);
echo "<br/>----------<br/>";
$sql = "select * from users;";
echo $db->qw($sql, "uid");// . $db->get_err();

//print get_acc_source();

function selectAll($table)
{
	$db = new acc_DB();
	$results = $db->q("SELECT * FROM $table");
	$cols = $results->numColumns();
	while ($row = $results->fetchArray()) {
		for ($i = 1; $i < $cols; $i++) {
			echo $results->columnName($i) . ': ';
			echo $row[$i] . "<br />\r\n";
		}
		//print_r($row);
		//echo 'Username: ' . $row['USERNAME'] . '<br />';
	}
	$db->d();
}

//selectAll("daybook_sub");

<?php

function s1() {
    echo "qq1" . "\n";
    return;
}

s1();
echo "qq2" . "\n";
exit;


$age=array(
    "Bill"=>array("k1" => "vb1", "k2"=>"vb2"),
    "Steve"=>array("k1" => "vS1", "k2"=>"vS2"),
    "Elon"=>array("k1" => "vE1", "k2"=>"vE2"),
);

$tmp = "Steve";
echo $age[$tmp]["k1"] . "\n" . $age[$tmp]["k2"];




function a(&$b){
  $b++;
}
$c = 0;
call_user_func_array('a', array(&$c));
echo "c=" . $c . "\n\n";
?>
?>